#!/usr/bin/env bash

# GBK 转换 utf8
find ./ -name "*.java" -type f -exec sh -c "iconv -f GB18030 -t UTF8 {} > {}.utf8" \;

# 批量修改文件
for i in `find . -name "*.java.utf8" -type f`;
do
    echo "$i"
    mv "$i" "${i%.java.utf8}.java";
done
